find_package( Qt4 4.5
    COMPONENTS
        QtCore
        QtGui
        QtNetwork
        QtXml
    REQUIRED
)
include( ${QT_USE_FILE} )

INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} )
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} )

set( SOURCES
    main.cpp
    AttributeWidget.cpp
    common.cpp
    ComponentTreeItem.cpp
    ComponentsTreeModel.cpp
    ConnectWidget.cpp
    ConversationWidget.cpp
    InfoChatWidget.cpp
    RoDebugViewerComponent.cpp
    RoViewer.cpp
    RoViewerComponent.cpp
)

set( HEADERS
    #common.h
    #ComponentTreeItem.h
    AttributeWidget.h
    ComponentsTreeModel.h
    ConnectWidget.h
    ConversationWidget.h
    InfoChatWidget.h
    RoDebugViewerComponent.h
    RoViewer.h
    RoViewerComponent.h
)

set( FORMS
    AttributeWidgetUI.ui
    ConnectWidget.ui
    ConversationWidgetUI.ui
    InfoChatWidgetUI.ui
)

qt4_automoc(
    ${SOURCES}
)

qt4_wrap_cpp( HEADERS_COMPILED
    ${HEADERS}
)

qt4_wrap_ui( FORMS_COMPILED
    ${FORMS}
)

add_executable( romashka-viewer
    ${SOURCES}
    ${HEADERS_COMPILED}
    ${FORMS_COMPILED}
)
set_target_properties( romashka-viewer
    PROPERTIES COMPILE_FLAGS "-g"
)
target_link_libraries( romashka-viewer
    ${QT_LIBRARIES}
    romashka # romashka-library
)
